package com.service.impl;

import com.dao.GoodsDao;
import com.pojo.Goods;
import com.pojo.ResponsePojo;
import com.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
    private GoodsDao goodsDao;
    @Autowired
    public void setGoodsDao(GoodsDao goodsDao) {
        this.goodsDao = goodsDao;
    }

    @Override
    public ResponsePojo findNewGoods() {
        return new ResponsePojo<>(200,"查询成功",goodsDao.findNewGoods());
    }

    @Override
    public ResponsePojo findHot() {
        return new ResponsePojo<>(200,"查询成功",goodsDao.findHot());
    }

    @Override
    public ResponsePojo findById(int id) {
        return new ResponsePojo<>(200,"查询成功",goodsDao.findById(id));
    }
}
